//
//  HomeHoteView.swift
//  SwiftProject
//
//  Created by wwj on 16/2/25.
//  Copyright © 2016年 wwj. All rights reserved.
//

import UIKit

class HomeHoteView: UIView {
    let btnH: CGFloat = 80
    let bMargin: CGFloat = 10
    let btnW: CGFloat = (SCREEN_WITH - 20) * 0.25
    let sumCount: Int = 4
    override init(frame: CGRect) {
        super.init(frame: frame)
        addView()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func addView (){
        for var index=0; index<sumCount; index++ {
            let hotBtn = UIButton()
            let hotBtnX: CGFloat = CGFloat(index%4)*btnW + bMargin
            let hotBtnY: CGFloat = CGFloat(index/4)*btnH
            hotBtn.frame = CGRectMake(hotBtnX, hotBtnY, btnW, btnH)
            hotBtn.backgroundColor = UIColor.redColor()
            self.addSubview(hotBtn)
        }
    }
}
